from django.db import models
from django.contrib.auth.models import User
# Create your models here.


# 用户表

class UserProfile(models.Model):
    USER_GENDER_TYPE = (
        ('male', '男'),
        ('female', '女'),
    )
    email = models.EmailField(verbose_name='邮箱', max_length=64)
    role = models.EmailField(verbose_name='角色',null=True, blank=True)
    password = models.CharField(verbose_name='密码', max_length=64)
    nike_name = models.CharField('昵称', max_length=23, blank=True, default='')
    birthday = models.DateField('生日', null=True, blank=True)
    gender = models.CharField('性别', max_length=6, choices=USER_GENDER_TYPE, default='')
    address = models.CharField('地址', max_length=100, blank=True, default='')
    image = models.ImageField(upload_to='images/%y%m', default='img/default.png', max_length=100,verbose_name='用户头像')
    weixin = models.CharField('微信账号',max_length=64, blank=True, default='')
    create_time = models.DateTimeField(blank=True, null=True, default=None, verbose_name='创建时间')
    name = models.CharField(verbose_name='姓名', max_length=64, default=email)
    idcard = models.CharField(verbose_name='身份证号', max_length=64, null=True, blank=True)
    qq = models.CharField(verbose_name='QQ', max_length=64, null=True, blank=True)
    nation = models.CharField(verbose_name='民族', max_length=23, null=True, blank=True)


class InterfaceProfile(models.Model):
    STATE_TYPE = (
        (1, '正常'),
        (2, '待开发'),
        (3, '已废弃'),
    )
    name = models.CharField(verbose_name='接口名', max_length=64)
    address_before = models.CharField(verbose_name='接口前端地址',blank=True, max_length=64, default='')
    address_after = models.CharField(verbose_name='接口后端地址',blank=True, max_length=64, default='')
    state = models.IntegerField(verbose_name='接口状态', choices=STATE_TYPE, max_length=64, default=1)
    developer = models.CharField(verbose_name='接口状态', max_length=64,blank=True, default='')


